//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<binary_data.h>
///	@path	~/src/lib/memory/
///	@date	2007/11/17
///	@desc	Pointer holds a section of binary data.

#pragma once

#include "xeres.h"

namespace xeres {

	/*!
		\class	binary_data
		\brief	An encapsulated pointer to hold a section of binary data.
	*/
	class binary_data
	{
	public:

		/// \name Constructor & Destructor
		//@{

		/// \ctor_set
		binary_data( const void * data , size_t size );

		// \ctor_copy
		binary_data( const binary_data& rhs );

		/// \dtor
		~binary_data( void );

		//@}

		/// \name Data Manipulation
		//@{

		/*!
			\brief		Get data( to read ).
		*/
		const void * data( void ) const { return m_data; }

		/*!
			\brief		Get data( to write ).
		*/
		void * data( void ) { return m_data; }

		/*!
			\brief		Get data size.
		*/
		size_t size( void ) { return m_size; }

		//@}

	private:

	//@ data

		void *			m_data;
		size_t			m_size;

	};

} // namespace xeres
